# Contributor:
# Maintainer: Philipp Glaum <p@pglaum.de>
pkgname=py3-alembic
_pkgname=alembic
pkgver=1.13.1
pkgrel=2
pkgdesc="A database migration tool for SQLAlchemy."
url="https://pypi.org/project/alembic/"
arch="noarch"
license="MIT"
depends="
	py3-dateutil
	py3-mako
	py3-python-editor
	py3-sqlalchemy
	py3-typing-extensions
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest py3-tzdata"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	typing-ext.patch
	$pkgname-pytest8.patch::https://github.com/sqlalchemy/alembic/commit/6bdb9043868d4bd04ebe3fe8a4991735d5f87ed3.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
2a5826461bec22c2efc244dd8394d34d39ed6e3511a32e8e460057ab34f9e559d28dda4ea7e34ccd30628e889a3cb37cb156596e37dba748c12a0195d78aa678  alembic-1.13.1.tar.gz
6191e7eff621e3ceb9a28a239e2d8ad2d5606f04fd0c0db39722236f6c69bd442a9a277c0fd013e55e60d1442274742d1f6adfc8c0612aa6bbb88aa0b5bf6600  typing-ext.patch
e3c5aff773c5a82babaffbc9a462a22efea7ae3fa3d6ece2757042dedbad62a31441355c0701601c1b138abc663fe8ba0bcaa6cff2501e407ea851b82f6dce06  py3-alembic-pytest8.patch
"
